import type { RequestHandler } from "@sveltejs/kit" import Status from "$lib/models/status" import type Scope from "$lib/models/scope" export const get: RequestHandler = async({params}) => { const scopeId = parseInt(params.scope); const scope = scopes.find(s => s.id === scopeId); if (scope === null) { return { status: 404, headers: { "Content-Type": "application/json" }, body: JSON.stringify({ message: "Scope not found", }), } } return { status: 200, headers: { "Content-Type": "application/json" }, body: JSON.stringify({ scope }), } } const scopes: Scope[] = [ { id: 1, name: "3D Modeling", abbreviation: "3D", stats: [ {id: 101, name: "Asset", weight: 0.1, description: "Some description"}, {id: 102, name: "Tweak", weight: 0.2, description: "Some description"}, { id: 103, name: "Complexity", weight: 1, description: "Some description", allowedAmounts: { "Basic": 1, "Medium": 3, "Complex": 6, "Excessive": 12, } }, {id: 104, name: "Hard Surface", weight: 0.4, description: "Some description"}, {id: 105, name: "UV Mapping", weight: 0.2, description: "Some description"}, {id: 106, name: "Third-Party Asset", weight: 0.1, description: "Some description"}, {id: 107, name: "Material", weight: 0.1, description: "Some description"}, ], activeProjects: [ {id: 1001, name: "3D Maps: Proving the Concept", status: Status.Active}, {id: 1002, name: "Redrock HQ", status: Status.Active}, {id: 1003, name: "Tutorial: Realistic Environments", status: Status.Background}, ] }, { id: 2, name: "Roleplay", abbreviation: "RP", stats: [ {id: 201, name: "Story", weight: 3, description: "Some description"}, {id: 202, name: "Story Word", weight: 0.002, description: "Some description"}, {id: 203, name: "Worldbuilding", weight: 0.50, description: "Some description"}, {id: 204, name: "Characterbuilding", weight: 0.50, description: "Some description"}, {id: 205, name: "Note", weight: 1, description: "Some description"}, {id: 206, name: "Wiki Section", weight: 1, description: "Some description"}, {id: 207, name: "Wiki Research", weight: 0.5, description: "Some description"}, {id: 208, name: "Wiki Complexity", weight: 0.5, description: "Some description"}, ], activeProjects: [ {id: 2001, name: "Ilyna T'Rea", status: Status.Active}, {id: 2002, name: "Renala T'Iavay", status: Status.Active}, {id: 2003, name: "Background Stories", status: Status.Background}, ] }, //{id: 3, name: "Minecraft", abbreviation: "MC"}, //{id: 4, name: "Coding", abbreviation: "CODE"}, //{id: 5, name: "System Administration", abbreviation: "SA"}, ]